package com.fruit.service.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fruit.service.weather.impl.WeatherService;
import com.fruit.util.DateUtil;

import lombok.extern.slf4j.Slf4j;
/**
 * 天气调度
 * @author Administrator
 * @version 2017.11.30 17:40
 */
@Slf4j
@Service("weatherTaskJob")
public class WeatherTaskJob {
	@Autowired
	private WeatherService weather;
	/**
	 * 任务
	 */
	public void doJob() {
		log.info("【基地天气任务调度】----【开始】---【" + DateUtil.getTime() + "】------------");
		try {
			weather.updateAllBaseWeather();
		} catch (Exception e) {
			log.info("【基地天气任务调度】----【异常】---【" + DateUtil.getTime() + "】------------");
		} finally {
			log.info("【基地天气任务调度】----【结束】---【" + DateUtil.getTime() + "】------------");
		}
		
	}
	
}
